package org.example.account;

import io.seata.spring.annotation.datasource.EnableAutoDataSourceProxy;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;

/**
 * 这个是要特别注意的地方，seata对数据源做了代理和接管，在每个参与分布式事务的服务中，都要做如下配置
 * 取消数据源自动创建的配置
 * <code>@SpringBootApplication(exclude = DataSourceAutoConfiguration.class)</code>
 * @author shenguangyang
 */
@SpringBootApplication(exclude = DataSourceAutoConfiguration.class)
@MapperScan("org.example.account.mapper")
@EnableAutoDataSourceProxy
@EnableFeignClients
@EnableDiscoveryClient
public class SeataAccountApplication {
    public static void main(String[] args) {
        SpringApplication.run(SeataAccountApplication.class, args);
    }
}